n, l, t = input().split()
pos = [int(num) for num in input().split()]
pos2 = [num for num in pos]
len = int(n)
T = int(t)
bos = []
for index in range(int(n)):
    bos.append(1)
for i in range(T):
    for j in range(len):
        pos2[j] = pos[j]
    for j in range(len):
        if (pos2[j] == int(l) and bos[j] == 1) or (pos2[j] == 0 and bos[j] == -1):
            bos[j] *= -1
        else:
            for k in range(len):
                if pos2[j] == pos2[k] and j != k:
                    bos[j] *= -1
        pos[j] += bos[j]
for i in pos:
    x = int(i)
    print(x, end=' ')
